Imports System.Configuration.Provider

Public MustInherit Class QuestionnaireProvider
    Inherits ProviderBase

    Protected Sub New()
    End Sub

    ' Properties
    Public MustOverride Property ApplicationName() As String


#Region "For Category Manager"

    Public MustOverride Function CreateCategory(ByVal name As String, ByVal desc As String) As Category
    Public MustOverride Function DeleteCategory(ByVal id As Integer, ByVal name As String) As Boolean
    Public MustOverride Function GetCategories() As DataView
    Public MustOverride Function GetCategory(ByVal id As Integer) As String
    Public MustOverride Sub UpdateCategory(ByVal cat As Category)

#End Region

#Region "For Queston"

    Public MustOverride Function DeleteQuestion(ByVal id As Integer) As Boolean

    Public MustOverride Function CreateQuestion( _
    ByVal categoryId As Integer, _
    ByVal question As String, _
    ByVal configuration As String, _
    Optional ByVal choices As DataView = Nothing) As Question

    Public MustOverride Function GetChoices(ByVal id As Integer) As DataTable

    Public MustOverride Function GetQuestions( _
    ByVal categoryId As Integer, _
    ByVal stringToSearch As String) As DataView

    Public MustOverride Function GetQuestion(ByVal id As Integer) As Question

    Public MustOverride Sub UpdateQuestion( _
    ByVal question As Question, _
    Optional ByVal choices As DataView = Nothing)

#End Region

#Region "For Instrument"

    Public MustOverride Function CreateInstrument( _
    ByVal instrumentId As String, _
    ByVal name As String) As Instrument

    Public MustOverride Function GetInstrument(ByVal instrumentId As String) As Instrument

    Public MustOverride Function DeleteInstrument(ByVal instrumentId As String) As Boolean

    Public MustOverride Function GetInstruments( _
    ByVal fieldToSearch As String, _
    ByVal stringToSearch As String) As DataView

    Public MustOverride Sub UpdateInstrument( _
    ByVal instrument As Instrument, _
    ByVal original_instrumentId As String)

    Public MustOverride Sub LockInstrument( _
    ByVal instrumentId As String)

#End Region

#Region "For Instrument & Questions"

    'Questions
    Public MustOverride Function AddInstrumentQuestion( _
    ByVal instrumentId As String, _
    ByVal questionId As Integer) As Boolean

    Public MustOverride Function DeleteInstrumentQuestion( _
    ByVal uid As String) As Boolean

    Public MustOverride Function GetInstrumentQuestions( _
    ByVal instrumentId As String) As DataView

    Public MustOverride Sub UpdateInstrumentQuestion( _
    ByVal uid As String, _
    ByVal questionID As Integer)


    'Logics
    Public MustOverride Function AddInstrumentLogic( _
    ByVal parentUid As String, _
    ByVal questionId As Integer, _
    ByVal logic As String) As Boolean

    Public MustOverride Function GetInstrumentLogics( _
    ByVal parentUid As String) As DataView

    Public MustOverride Function GetInstrumentLogic( _
    ByVal uid As String) As Logic

    Public MustOverride Sub UpdateInstrumentLogic( _
    ByVal uid As String, _
    ByVal questionId As Integer, _
    ByVal logic As String)

#End Region

#Region "For Questionnaire"

    Public MustOverride Function CreateQuestionnaire( _
        ByVal studyId As String, _
        ByVal visitNumber As Byte, _
        ByVal instrumentId As String, _
        ByVal desc As String, _
        ByVal createdBy As String) As Questionnaire

    Public MustOverride Function DeleteQuestionnaire( _
        ByVal questionnaireId As Integer) As Boolean

    Public MustOverride Function GetQuestionnaire( _
        ByVal questionnaireId As Integer) As Questionnaire

    Public MustOverride Function GetQuestionnaires( _
        ByVal studyId As String, _
        ByVal instrumentId As String) As DataView

    Public MustOverride Sub UpdateQuestionnaire( _
        ByVal questionnaire As Questionnaire)

    Public MustOverride Sub UpdateQuestionnaireEditingPerm( _
    ByVal id As Integer, _
    ByVal perm As String, _
    ByVal updatedBy As String)

    Public MustOverride Sub UpdateQuestionnaireTakingPerm( _
    ByVal id As Integer, _
    ByVal perm As String, _
    ByVal updatedBy As String)

    Public MustOverride Function GetStudyIDs() As DataView

    Public MustOverride Function GetInstrumentIDs() As DataView

#End Region

#Region "For Reports"

    Public MustOverride Function GetQuestionnaireAnswer( _
        ByVal QuestionnaireID As Integer) As System.Data.DataView

#End Region

End Class
